package org.fujay.langchain4jserver.infrastructure.persistence.mybatis.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.fujay.mybatis.core.base.BaseEntity;

import java.time.LocalDateTime;

/**
 * 消息持久化实体 (对应 message 表 - 需要新建)
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "message")
public class MessagePo extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(value = "conversation_id")
    private Long conversationId;

    /**
     * 对应 MessageType 枚举 (USER, AI, SYSTEM)
     */
    @TableField(value = "message_type")
    private String messageType;

    @TableField(value = "content")
    private String content;

    @TableField(value = "timestamp")
    private LocalDateTime timestamp;

    @TableField(value = "token_usage")
    private String tokenUsageJson;

    @TableField(value = "metadata")
    private String metadataJson;

    /**
     * 图片 URL 列表 (JSON 字符串)
     */
    @TableField(value = "image_urls")
    private String imageUrlsJson;
}
